<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>JS运算符_一元运算符</title>

    <script>
        var a = 3;
        //var num = a++;
        var num = ++a;
        document.write(num + "<br>");
        document.write(a);
        document.write("<hr>");

        //var b = +3;
        //var b = -3;
        var b = +"123abc";
        document.write(typeof(b) + "<br>");
        document.write(b + 1);
        document.write("<hr>");

        var flag = true;
        var flag2 = false;
        var flag3 = + true;
        var flag4 = + false;
        document.write(typeof(flag) + "<br>");
        document.write(flag + "<br>");
        document.write(flag2 + "<br>");
        document.write(flag3 + "<br>");
        document.write(flag4 + "<br>");

    </script>
</head>
<body>

</body>
</html>